Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rax-canvas

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rax-canvas

canvas for Rax.

  • 0.6.5
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

rax-canvas

npm

Rax canvas api.

Rely on gcanvas in weex.

Install

$ npm install rax-canvas --save

Import

import Canvas from 'rax-canvas';

Init

use canvas:

<Canvas style={{
  width: 750,
  height: 750
}} ref="raxCanvas" />;

Props

nametypedefaultdescribe
styleObject{width: 750, height: 400}

Example

// demo
import {createElement, Component, render} from 'rax';
import Canvas from 'rax-canvas';

class CanvasSample extends Component {
  componentDidMount() {
    const contextPromise = this.refs.raxCanvasDemo.getContext();
    contextPromise.then((context) => {
      context.fillStyle = 'red';
      context.fillRect(0, 0, 100, 100);
    });
  }

  render() {
    return <Canvas style={{
      width: 750,
      height: 750
    }} ref="raxCanvasDemo" />;
  }
}

render(<CanvasSample />);

Keywords

FAQs

Package last updated on 23 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc